import request from "@/utils/http";

// 固收组观点汇总查询接口
export async function selectList(params?: any): Promise<any> {
  return request(`/api/rate/seller_fixed_income/selectList`, {
    method: "POST",
    data: params,
  });
}
// 宏观组观点汇总查询接口
export async function macro_selectList(params?: any): Promise<any> {
  return request(`/api/rate/seller_macrography/selectList`, {
    method: "POST",
    data: params,
  });
}

export async function fixed_export(params?: any): Promise<any> {
  return request(`/api/rate/seller_fixed_income/exportSelectList`, {
    method: "POST",
    responseType: 'blob',
    data: params,
  });
}
export async function macro_export(params?: any): Promise<any> {
  return request(`/api/rate/seller_macrography/exportSelectList`, {
    method: "POST",
    responseType: 'blob',
    data: params,
  });
}

export async function monetary_export(params?: any): Promise<any> {
  return request(`/api/rate/monetary_policy_report/exportSelectList`, {
    method: "POST",
    responseType: 'blob',
    data: params,
  });
}

// 查询固收券商
export async function queryBroker(params?: any): Promise<any> {
  return request(`/api/rate/seller_fixed_income/queryBroker`, {
    method: "POST",
    data: params,
  });
}

// 查询宏观券商
export async function queryMacroBroker(params?: any): Promise<any> {
  return request(`/api/rate/seller_macrography/queryBroker`, {
    method: "POST",
    data: params,
  });
}

// 自定义指标
export async function getIndexConfig(params?: any): Promise<any> {
  return request(`/api/admin/sys_fund_config/select`, {
    method: "post",
    data: params,
  });
}

// 保存自定义指标
export async function setIndexConfig(params?: any): Promise<any> {
  return request(`/api/admin/sys_fund_config/save`, {
    method: "post",
    data: params,
  });
}

// 新增卖方固收组观点
export async function saveSellerIncom(params?: any): Promise<any> {
  return request(`/api/rate/seller_fixed_income/save`, {
    method: "post",
    data: params,
  });
}

// 删除卖方固收组观点
export async function deleteSellerIncom(params?: any): Promise<any> {
  return request(`/api/rate/seller_fixed_income/removeById`, {
    method: "post",
    data: params,
  });
}

// 新增卖方固收组观点
export async function saveMacrography(params?: any): Promise<any> {
  return request(`/api/rate/seller_macrography/save`, {
    method: "post",
    data: params,
  });
}

// 删除卖方固收组观点
export async function deleteMacrography(params?: any): Promise<any> {
  return request(`/api/rate/seller_macrography/removeById`, {
    method: "post",
    data: params,
  });
}

// 校验固收组券商名称是否重复
export async function validateBroker(params?: any): Promise<any> {
  return request(`/api/rate/seller_fixed_income/check`, {
    method: "post",
    data: params,
  });
}

// 校验宏观组券商名称是否重复
export async function validateMacroBroker(params?: any): Promise<any> {
  return request(`/api/rate/seller_macrography/check`, {
    method: "post",
    data: params,
  });
}

// 查询日期回显
export async function queryBrokerDate(params?: any): Promise<any> {
  return request(`/api/rate/seller_fixed_income/queryDate`, {
    method: "post",
    data: params,
  });
}

// 查询宏观日期回显
export async function queryMacroBrokerDate(params?: any): Promise<any> {
  return request(`/api/rate/seller_macrography/queryDate`, {
    method: "post",
    data: params,
  });
}

// 货币政策执行报告可查询报告期接口
export async function queryMonetaryDate(params?: any): Promise<any> {
  return request(`/api/rate/monetary_policy_report/queryReport`, {
    method: "post",
    data: params,
  });
}

// 通过ReportDate查询执行报告
export async function queryMonetaryReportTable(params?: any): Promise<any> {
  return request(`/api/rate/monetary_policy_report/queryReportTable`, {
    method: "post",
    data: params,
  });
}

// 通过ReportDate查询单个执行报告
export async function queryMonetaryReportSigTable(params?: any): Promise<any> {
  return request(`/api/rate/monetary_policy_report/getByReportDate`, {
    method: "post",
    data: params,
  });
}

// 新增页面的日期可选范围接口
export async function queryMonetaryAddOptions(params?: any): Promise<any> {
  return request(`/api/rate/monetary_policy_report/selectReport`, {
    method: "post",
    data: params,
  });
}

// 保存执行报告
export async function saveMonetaryReport(params?: any): Promise<any> {
  return request(`/api/rate/monetary_policy_report/save`, {
    method: "post",
    data: params,
  });
}

// 保存执行报告
export async function getMaxReport(params?: any): Promise<any> {
  return request(`/api/rate/monetary_policy_report/getMaxReport`, {
    method: "post",
  });
}

